<template>
  <div class="app-main-container tabpdding">
    <el-tabs v-model="activeTab">
      <el-tab-pane v-if="meta.indexOf('curriculumSales') > -1" label="课程销售统计" name="0"><CurriculumSales v-show="activeTab === '0'" /></el-tab-pane>
      <el-tab-pane v-if="meta.indexOf('CourseSaleDetail') > -1" label="课程销售明细" name="1"><CurriculumDetail v-if="activeTab === '1'" /></el-tab-pane>
      <!-- <el-tab-pane v-if="meta.indexOf('CurriculumDetailb') > -1" label="线上课程报名明细" name="2"><CurriculumDetailb v-if="activeTab === '2'" /></el-tab-pane> -->
    </el-tabs>
  </div>
</template>

<script>
import CurriculumDetail from './curriculumDetail'
// import CurriculumDetailb from './curriculumDetailb'
import CurriculumSales from './curriculumSales'
export default {
  name: 'CurriculumRela',
  components: {
    CurriculumDetail,
    // CurriculumDetailb,
    CurriculumSales
  },
  data() {
    return {
      activeTab: '0',
      meta: []
    }
  },
  created() {
    let activeTab = ''
    const meta = this.$route.meta.buttons || []
    if (meta.indexOf('curriculumSales') > -1) {
      activeTab = '0'
    } else if (meta.indexOf('CourseSaleDetail') > -1) {
      activeTab = '1'
    }
    this.activeTab = activeTab
    this.meta = meta
  }

}
</script>

